-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement: queue or cancel previous connect request #6691
base: main
Are you sure you want to change the base?
improvement: queue or cancel previous connect request #6691
Conversation
333669a
to
b1564af
Compare
b1564af
to
3f2a29b
Compare
@@ -211,18 +212,12 @@ class SbtBloopLspSuite | |||
_ = assertNoDiff( | |||
client.beginProgressMessages, | |||
List( | |||
progressMessage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't deduplicate like this anymore. Instead requests will be queued and the first one will get cancelled. So sbt bloopInstall
will be executed twice, and the first request will be cancelled after that, so import
and indexing
are executed only once.
val iter = queue.iterator() | ||
while (iter.hasNext()) { | ||
val curr = iter.next() | ||
request.cancelCompare(iter.next().request) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the logic a bit better here? Could we use some case objects instead of just numbers?
|
||
class Interruptable[+T] private ( | ||
futureIn: Future[T], | ||
cancelPromise: Promise[Unit], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to forward the cancel request to an underlying process if for example bloopInstall is running?
No description provided.